<?php /* Smarty version Smarty3-SVN$Rev: 3286 $, created on 2011-10-22 10:08:23
         compiled from "D:\www\beimuaihui/views/admin\system/user_usergrouprole.tpl" */ ?>
<?php /*%%SmartyHeaderCode:229864ea22597e472b8-84464783%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '514b5bd01b13e092a36e180f62be1e58213e1792' => 
    array (
      0 => 'D:\\www\\beimuaihui/views/admin\\system/user_usergrouprole.tpl',
      1 => 1314408874,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '229864ea22597e472b8-84464783',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
)); /*/%%SmartyHeaderCode%%*/?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html>
<head>
	<?php $_template = new Smarty_Internal_Template('header.tpl', $_smarty_tpl->smarty, $_smarty_tpl, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null);
$_template->assign('JS',@BAOGG_JS);$_template->assign('CSS',@BAOGG_CSS); echo $_template->getRenderedTemplate(); $_template->rendered_content = null;?><?php unset($_template);?>
        <script type="text/javascript"> 
        
          	Ext.onReady(function(){
          		Ext.get("submit").on("click",function(){
	          		Ext.Ajax.request({
	          		    form: 'form1',
	          		  	success: function(form, action) {		
	          		  		//console.info(action);		
	          		  	  var result=Ext.decode(form.responseText);
	          		  	  if(result.success){
		          		  		 top.top.Ext.example.msg('<?php echo $_smarty_tpl->getVariable('LANG')->value['save'];?>
', '<?php echo $_smarty_tpl->getVariable('LANG')->value['save_ok'];?>
');
			          		  	 parent.Ext.getCmp("user_group_role_<?php echo $_smarty_tpl->getVariable('user_id')->value;?>
").close();
	          		  	  }else{
		          		  		 Ext.MessageBox.show({
			          		           title: '<?php echo $_smarty_tpl->getVariable('LANG')->value['save_fail'];?>
',
			          		           msg: result.msg,
			          		           buttons: Ext.MessageBox.OK,
			          		           icon:  Ext.MessageBox.ERROR
			          		       });
	          		  	  }					   				
	     			    },
	     			   failure: function(form, action) {
	    					switch (action.failureType) {
	    					    case Ext.form.Action.CLIENT_INVALID:
	    						top.Ext.example.msg('<?php echo $_smarty_tpl->getVariable('LANG')->value['save_fail'];?>
', "Form fields may not be submitted with invalid values");
	    						break;
	    					    case Ext.form.Action.CONNECT_FAILURE:
	    						top.Ext.example.msg('<?php echo $_smarty_tpl->getVariable('LANG')->value['save_fail'];?>
', "Ajax communication failed");
	    						break;
	    					    case Ext.form.Action.SERVER_INVALID:
	    					       top.Ext.example.msg('<?php echo $_smarty_tpl->getVariable('LANG')->value['save_fail'];?>
', action.result.msg);
	    					       break;
	    					    default:
	    					      top.Ext.example.msg('<?php echo $_smarty_tpl->getVariable('LANG')->value['save_fail'];?>
', action.result.msg);
	    					      break;
	    				       }
	    				   }
	          		});

          		});
          		 
          	});
          	
          </script>	
</head>
<body>       
<form method="post" id="form1" name="form1" action="<?php echo $_smarty_tpl->getVariable('form_url')->value;?>
">

	<div id="toolbar">
		<input type="button" id="submit" value="<?php echo $_smarty_tpl->getVariable('LANG')->value['save'];?>
" />
	</div>
<hr />
	
	<div id="form">
		<!-- 
		<div>
		<input type="checkbox" name="include_sub_group" id="include_sub_group" /><lable for="include_sub_group"><?php echo $_smarty_tpl->getVariable('LANG')->value['include_sub_group'];?>
</lable>
		</div>
		--> 
		<br />
		</div>
		<table class="grid">
			<thead>
				<th><!-- <input type="checkbox" /> --></th>
				
				<th><?php echo $_smarty_tpl->getVariable('LANG')->value['user_group_id'];?>
</th>
				<th><?php echo $_smarty_tpl->getVariable('LANG')->value['role_id'];?>
</th>
				
			</thead>
			<tbody>
			<tr>
				<td><input type="checkbox" name="user_group_id[0]"
				<?php if (isset($_smarty_tpl->getVariable('user_group_roles',null,true,false)->value[0])){?>
					checked
				 <?php }?>
				
				  /></td>
				<td><?php echo $_smarty_tpl->getVariable('LANG')->value['personal'];?>
</td>
				<td>
				<?php  $_smarty_tpl->tpl_vars['role'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('roles')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['role']->key => $_smarty_tpl->tpl_vars['role']->value){
?>
					<?php if ($_smarty_tpl->tpl_vars['role']->value['is_default']==1){?>
					
						<input type="checkbox" name="role_id[0][]" value="<?php echo $_smarty_tpl->tpl_vars['role']->value['role_id'];?>
" 
						<?php if (isset($_smarty_tpl->getVariable('user_group_roles',null,true,false)->value[0][$_smarty_tpl->tpl_vars['role']->value['role_id']])){?>
							checked
						 <?php }?>
						/><lable><?php echo $_smarty_tpl->tpl_vars['role']->value['role_name'];?>
</lable> &nbsp;
					<?php }?> 
				<?php }} ?>
				</td>	
			</tr>
			<?php  $_smarty_tpl->tpl_vars['user_group'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('user_groups')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['user_group']->key => $_smarty_tpl->tpl_vars['user_group']->value){
?>			
			<tr>
				<td><input type="checkbox" name="user_group_id[<?php echo $_smarty_tpl->tpl_vars['user_group']->value['user_group_id'];?>
]"
				<?php if (isset($_smarty_tpl->getVariable('user_group_roles',null,true,false)->value[$_smarty_tpl->tpl_vars['user_group']->value['user_group_id']])){?>
					checked
				 <?php }?> /></td>
				<td> <?php echo $_smarty_tpl->tpl_vars['user_group']->value['user_group_name'];?>
</td>
				<td>
				<?php  $_smarty_tpl->tpl_vars['role'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('roles')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['role']->key => $_smarty_tpl->tpl_vars['role']->value){
?>
					<?php if ($_smarty_tpl->tpl_vars['role']->value['is_default']==0){?>
						<input type="checkbox" name="role_id[<?php echo $_smarty_tpl->tpl_vars['user_group']->value['user_group_id'];?>
][]" value="<?php echo $_smarty_tpl->tpl_vars['role']->value['role_id'];?>
" 
							<?php if (isset($_smarty_tpl->getVariable('user_group_roles',null,true,false)->value[$_smarty_tpl->tpl_vars['user_group']->value['user_group_id']][$_smarty_tpl->tpl_vars['role']->value['role_id']])){?>
							checked
						 <?php }?>
						/><lable><?php echo $_smarty_tpl->tpl_vars['role']->value['role_name'];?>
</lable> &nbsp; 
					<?php }?>
				<?php }} ?>
				</td>	
			</tr>
			<?php }} ?>
			</tbody>
		</table>
		<input type="hidden" name="user_id" value="<?php echo $_smarty_tpl->getVariable('user_id')->value;?>
" />

		

</form>
</body>
</html>